//
//  BaseViewController.m
//  Pitch
//
//  Created by zhujinhui on 14-9-13.
//  Copyright (c) 2014年 zhujinhui. All rights reserved.
//

#import "BaseViewController.h"
#import "UIColor+Hex.h"
#import "EnvironmentConfigure.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)refreshDataWithService:(NSString *)service andResponse:(NetworkResponse *) response{
    
}

static UILabel *label = nil;

-(void) addNoDataIndicatorView{
    if (nil == label) {
        label = [[UILabel alloc]init];
        CGRect rectCenter = [EnvironmentConfigure screenSize];
        rectCenter.origin.x = (rectCenter.size.width - INDICATORVIEW_WIDTH)/2;
        rectCenter.origin.y = (rectCenter.size.height +INDICATORVIEW_HEIGHT)/2;
        rectCenter.size.width = INDICATORVIEW_WIDTH;
        rectCenter.size.height = INDICATORVIEW_HEIGHT;
        
        label.frame = rectCenter;
        label.text = @"暂无数据可供显示";
        label.textAlignment = NSTextAlignmentCenter;
        label.textColor = kGrayColor_1;
        [self.view addSubview:label];
        [self.view bringSubviewToFront:label];
    }
    
}


-(void) removeNoDataIndicatorView{
    [label removeFromSuperview];
    label = nil;
}


-(void)dealloc{
    [self removeNoDataIndicatorView];
}

@end
